package com.ley.yikang.service.serviceimpl;

import com.ley.yikang.entity.HealthInfo;
import com.ley.yikang.mapper.HealthInfoMapper;
import com.ley.yikang.service.HealthInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HealthInfoServiceImpl implements HealthInfoService {
    private final HealthInfoMapper healthInfoMapper;

    @Autowired
    public HealthInfoServiceImpl(HealthInfoMapper healthInfoMapper) {
        this.healthInfoMapper = healthInfoMapper;
    }

    @Override
    public HealthInfo getHealthInfo(int elderId) {
        return healthInfoMapper.getHealthInfo(elderId);
    }

    @Override
    public void updateHealthInfo(HealthInfo healthInfo) {
        healthInfoMapper.updateHealthInfo(healthInfo);
    }

    @Override
    public void addHealthInfo(HealthInfo healthInfo) {
        healthInfoMapper.addHealthInfo(healthInfo);
    }

    @Override
    public void delHealthInfo(int id) {
        healthInfoMapper.delHealthInfo(id);
    }
}
